package com.hubei.car.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户实体类
* luokangtao
 * 2019/07/22
*/
@ApiModel(value="用户实体类")
@Data
@Accessors(chain = true) //开启链写编程
@TableName(value = "hb_user")
public class HbUser implements Serializable {
    /**
     * 用户主键id
     */
    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value="用户主键id")
    private Long id;

    /**
     * 用户登陆名
     */
    @TableField(value = "loginname")
    @ApiModelProperty(value="用户登陆名",example = "haobinkeji",required = true)
    @NotEmpty(message = "登录名不能为空")
    @Size(min = 8,max = 30,message = "用户登陆名限制输入8~30个字符")
    private String loginName;

    /**
     * 用户密码
     */
    @TableField(value = "password")
    @ApiModelProperty(value="用户密码",example = "默认密码:12345678",hidden = true)
    private String password;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @ApiModelProperty(value="创建时间",hidden = true)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    @ApiModelProperty(value="修改时间",hidden = true)
    private LocalDateTime updateTime;

    /**
     * 创建时间
     */
    @TableField(exist = false)
    @ApiModelProperty(value="创建时间字符串")
    private String createTimeString;

    /**
     * 修改时间
     */
    @TableField(exist = false)
    @ApiModelProperty(value="修改时间字符串")
    private String updateTimeString;

    /**
     * 姓名
     */
    @TableField(value = "username")
    @ApiModelProperty(value="姓名",example = "罗斌")
    @Size(min = 0,max = 10,message = "名字最大不能超过10位")
    private String userName;

    /**
     * 别名
     */
    @TableField(value = "aliasname")
    @ApiModelProperty(value="用户昵称",example = "罗老板")
    @Size(min = 0,max = 10,message = "用户昵称最大不能超过10位")
    private String aliasName;

    /**
     * 性别 0:女 1:男
     */
    @TableField(value = "sex")
    @ApiModelProperty(value="性别",example = "1",required = true)
    private String sex;

    /**
     * 邮箱地址
     */
    @TableField(value = "email")
    @ApiModelProperty(value="邮箱地址",example = "haobinkeji@qq.com")
    private String email;

    /**
     * 联系方式
     */
    @TableField(value = "phone")
    @ApiModelProperty(value="联系方式",example = "13928252916")
    @Size(min = 0,max = 11,message = "手机号码不能超过11位")
    private String phone;

    /**
     * QQ
     */
    @TableField(value = "qq")
    @ApiModelProperty(value="294311248")
    private String qq;

    /**
     * 用户状态
     */
    @TableField(value = "status")
    @ApiModelProperty(value="用户状态",hidden = true)
    private String status;

    /**
     * 角色: 0:普通(common) 1:管理员 (admin) 2:超级管理员(superadmin)
     */
    @TableField(value = "roles")
    @ApiModelProperty(value = "角色:0:普通(common) 1:管理员 (admin) 2:超级管理员(superadmin)",example = "0")
    private String roles;


}